package wfm.ws.payment.rest;

import javax.ws.rs.WebApplicationException;

import wfm.bean.Ticket;

public class PaymentRESTServiceImpl implements PaymentRESTService
{
	
	public PaymentRESTServiceImpl()
	{
	}
	
	@Override
	public Ticket payBill(String firstName, String lastName,
			String street, String city, String zip, String country,
			String telNo, String mailAddress, String description)
	 throws WebApplicationException
	{				
		double randomNumber = Math.random();
		
		Ticket ticket = new Ticket(firstName,lastName,street,city,zip,country,telNo,mailAddress,description);
		if(ticket != null && randomNumber > 0.1){
			return ticket;
		}
		
		return null;
	}
}
